package com.cmc.cloud.cmclink.doc.vo.hscodevo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.*;

/**
 * hscode Base VO，提供给添加、修改、详细的子 VO 使用
 * 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
 *
 * @author codegen
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class HsCodeBaseVO {

    @Schema(description = "中文名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 1000, message = "{HsCodeBaseVO.descCn.Length}")
    private String descCn;

    @Schema(description = "英文名称", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{hsCodeEn.notBlank}")
    @Length(max = 1000, message = "{HsCodeBaseVO.descEn.Length}")
    private String descEn;

    @Schema(description = "订舱品名码", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "{hsCode.notBlank}")
    @Pattern(regexp = "^\\d{2,10}$", message = "{HsCodeBaseVO.hsCode.Pattern}")
    private String hsCode;

    @Schema(description = "是否启用")
    private Boolean enable;

    @Schema(description = "数据来源")
    @NotBlank(message = "{HsCodeBaseVO.dataSource.NotBlank}")
    @Length(max = 20, message = "{HsCodeBaseVO.dataSource.Length}")
    private String dataSource;
}
